package edu.tgc.entity.hrm;

import java.util.Date;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import edu.tgc.entity.file.FileResource;
import edu.tgc.entity.hrm.dictionary.HrmCertificateType;
import edu.tgc.entity.system.SysUser;

/**
 * @author faith
 *         证书
 */
@Entity
public class HrmCertificate extends FileResource {

    private static final long serialVersionUID = 3454087540855644119L;
    // 是否继教
    protected Boolean continueEdu;
    // 年审周期
    protected String cycle;
    protected String description;
    // 到期时间
    protected Date expiryDate;
    // 发证时间
    protected Date issueDate;
    // 公司需要
    protected Boolean need;
    // 编号
    protected String no;
    // 注册编号
    protected String regNo;
    protected Integer sort = 1;
    // 职称
    // 证书名称
    protected HrmCertificateType type;
    // 所属员工
    @JsonIgnoreProperties(value = { "createUser", "lastModifyUser", "createTime", "lastModifyTime", "dept", "description", "enabled", "ip", "username", "sort", "address", "dutyStatus", "education", "email", "hireDate", "idNo", "leaveDate", "major",
            "qq", "sex", "status", "telphone" })
    protected SysUser user;

    public HrmCertificate() {
    }

    public HrmCertificate(UUID id) {
        super(id);
    }

    public Boolean getContinueEdu() {
        return this.continueEdu;
    }

    @Column(length = 31)
    public String getCycle() {
        return this.cycle;
    }

    @Column(name = "description", length = 255)
    public String getDescription() {
        return this.description;
    }

    @Temporal(value = TemporalType.DATE)
    public Date getExpiryDate() {
        return this.expiryDate;
    }

    @Temporal(value = TemporalType.DATE)
    public Date getIssueDate() {
        return this.issueDate;
    }

    public Boolean getNeed() {
        return this.need;
    }

    @Column(length = 255)
    public String getNo() {
        return this.no;
    }

    @Column(length = 255)
    public String getRegNo() {
        return this.regNo;
    }

    @Column(name = "sort")
    public Integer getSort() {
        return this.sort;
    }

    @ManyToOne
    public HrmCertificateType getType() {
        return this.type;
    }

    @ManyToOne
    public SysUser getUser() {
        return this.user;
    }

    public void setContinueEdu(Boolean continueEdu) {
        this.continueEdu = continueEdu;
    }

    public void setCycle(String cycle) {
        this.cycle = cycle;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    public void setIssueDate(Date issueDate) {
        this.issueDate = issueDate;
    }

    public void setNeed(Boolean need) {
        this.need = need;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public void setRegNo(String regNo) {
        this.regNo = regNo;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public void setType(HrmCertificateType type) {
        this.type = type;
    }

    public void setUser(SysUser user) {
        this.user = user;
    }

}
